[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 LEFT(SEXP,IEXP) (STRING)

 Function
  Access the left most characters from a string.

 Syntax
  LEFT(str,chars)

   str   = A string expression to take the left most characters of.
   chars = An integer expression with the number of characters to take
           from the left end of str.

 Return Type & Value
  STRING
  Returns a string with the left most chars characters of str.

 Remarks
  This function will return a sub string with the left most chars
  characters of a specified string.  This can be useful in data processing
  as well as text formatting.  If chars is less than or equal to 0 then the
  returned string will be empty.  If chars is greater than the length of
  str then the returned string will have spaces added to the left to pad
  it out to the full length specified.

 Examples
  WHILE (RANDOM(250) <> 0) PRINT LEFT(RANDOM(250),4)," "

  STRING s
  FOPEN 1,"DATA.TXT",O_RD,S_DN
  WHILE (!FERR(1)) DO
    FGET 1,s
    PRINT RTRIM(LEFT(s,25)," ")," - "
    PRINTLN RIGHT(s,LEN(s)-25)
  ENDWHILE
  FCLOSE 1

See Also: MID() RIGHT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson